package com.atwisdom.star.dcs.Thread;

import com.atwisdom.star.dcs.service.Impl.RealTimeMinuteStatServiceImpl;
import com.atwisdom.star.dcs.util.Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class RealTimeInfoMinuteTread implements Runnable  {

    @Autowired
    private RealTimeMinuteStatServiceImpl realTimeMinuteStatService;

    @Override
    public void run() {
        while (true) {
            System.out.println("按分钟统计开始啦");
            try {
                realTimeMinuteStatService.realTimeDataStat();
            }catch (Exception ex){
                ex.printStackTrace();
            }
            System.out.println("按分钟统计暂停5分钟，休息一会儿");
            Utils.sleep(60000l);
        }
    }
}
